package com.shrct.businessprocess.customerservice.events;

import com.shrct.businessprocess.customerservice.RCFaultReport;
import com.shrct.businessprocess.customerservice.RCFaultReportProduct;
import com.shrct.businessprocess.customerservice.RCFaultWorkItem;
import com.shrct.businessprocess.customerservice.RCTimeLevel;
import com.shrct.businessprocess.customerservice.events.RCFaultReportEventsListener;
import edu.fudan.mylang.pf.event.EntityEventsManager;
import java.util.Collection;
import java.util.Date;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("com.shrct.businessprocess.customerservice.events.RCFaultReportEventsManager")
public class RCFaultReportEventsManager extends EntityEventsManager<RCFaultReport> {
  @Autowired(required = false)
  private Collection<RCFaultReportEventsListener> listeners = com.google.common.collect.Lists.newArrayList();;
  
  protected Collection<RCFaultReportEventsListener> getListeners() {
    return listeners;
  }
  
  public void fireProcessReport(final RCFaultReport entity, final Date time, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).processReport(entity,time,comment);
    }
    
  }
  
  public void fireAssign(final RCFaultReport entity, final Procedure1<? super RCFaultWorkItem> preInit, final String comment, final Procedure1<? super RCFaultWorkItem> postProcess) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).assign(entity,preInit,comment,postProcess);
    }
    
  }
  
  public void fireEngineerReport(final RCFaultReport entity, final RCFaultWorkItem workItem, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).engineerReport(entity,workItem,comment);
    }
    
  }
  
  public void fireAppendInfo(final RCFaultReport entity, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).appendInfo(entity,comment);
    }
    
  }
  
  public void fireRequireRMA(final RCFaultReport entity, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).requireRMA(entity,comment);
    }
    
  }
  
  public void fireRMAPerformed(final RCFaultReport entity, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).RMAPerformed(entity,comment);
    }
    
  }
  
  public void fireRepairPerformed(final RCFaultReport entity, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).repairPerformed(entity,comment);
    }
    
  }
  
  public void fireUpgrade2Level(final RCFaultReport entity, final RCTimeLevel level) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).upgrade2Level(entity,level);
    }
    
  }
  
  public void firePend(final RCFaultReport entity, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).pend(entity,comment);
    }
    
  }
  
  public void fireResume(final RCFaultReport entity, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).resume(entity,comment);
    }
    
  }
  
  public void fire_delete(final RCFaultReport entity) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener)._delete(entity);
    }
    
  }
  
  public void fireStartDeviceRMA(final RCFaultReport entity, final RCFaultReportProduct device, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).startDeviceRMA(entity,device,comment);
    }
    
  }
  
  public void fireFinishDeviceRMA(final RCFaultReport entity, final RCFaultReportProduct device, final String comment) {
    for (edu.fudan.mylang.pf.event.IEntityEventsListner<?> listener : listeners) {
    	((RCFaultReportEventsListener)listener).finishDeviceRMA(entity,device,comment);
    }
    
  }
}
